<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.prime.com.tr/ui"
	xmlns:sf="http://www.springframework.org/tags/faces"
	xmlns:composite="http://java.sun.com/jsf/composite"
	>

<composite:interface>
	<composite:attribute name="dropdownMenuTitle" />
</composite:interface>
<composite:implementation>
	<div><h:form id="form">
		<h2 class="title ui-widget-header ui-corner-all">#{cc.attrs.dropdownMenuTitle}</h2>
		<table class="dataTable">
			<tr>
				<td><p:menubar>
					<p:submenu label="File">
						<p:submenu>
							<f:facet name="label">
								<p:menuitem value="New" icon="../resources/images/new.png" />
							</f:facet>
							<p:menuitem value="Project" 
								actionListener="#{menuBean.project}" update="out1" />
							<p:menuitem value="Other"
								actionListener="#{menuBean.other}" update="out1" />
						</p:submenu>
						<p:menuitem value="Open" icon="../resources/images/open.png"
							actionListener="#{menuBean.open}" update="out1" />
						<p:menuitem value="Quit" actionListener="#{menuBean.quit}"
							update="out1" />
					</p:submenu>

					<p:submenu label="Actions">
						<p:submenu label="Ajax">
							<p:menuitem value="Save" update="out1"
								actionListener="#{menuBean.save}" />
							<p:menuitem value="Update" update="out1"
								actionListener="#{menuBean.update}" />
						</p:submenu>
						<p:submenu label="Non-Ajax">
							<p:menuitem value="Delete" update="out1" ajax="false"
								actionListener="#{menuBean.delete}" />
						</p:submenu>
					</p:submenu>

					<p:submenu>
						<f:facet name="label">
							<p:menuitem value="Quit" url="/web/main" />
						</f:facet>
					</p:submenu>
				</p:menubar></td>
				<td>
				    <p:menuButton value="Options">
                    <p:menuitem value="Save" actionListener="#{menuBean.save}"
                        update="out1" />
                    <p:menuitem value="Update" actionListener="#{menuBean.update}"
                        update="out1" />
                    <p:menuitem value="Delete" actionListener="#{menuBean.delete}"
                        ajax="false" />                    
                </p:menuButton>
                <br></br>
				</td>            
			</tr>
			
			<tr>
				<td><h:outputText id="out1" value="#{menuBean.text}" /></td>
				<td></td>
			</tr>
			<tr>
			     
			</tr>
		</table>		
	</h:form></div>
</composite:implementation>
</html>